package com.unimas.dof.render;

import java.io.PrintWriter;

import javax.servlet.http.HttpServletResponse;

import com.unimas.dof.DOFContext;
import com.unimas.dof.view.JsonView;

public class JsonRender implements DOFRender<JsonView> {

	public void render(JsonView view, DOFContext context) throws Exception {
		HttpServletResponse response = context.getResponse();
		if (view == null) {
			return;
		}
		response.setContentType("application/json;charset=utf-8");
		PrintWriter out = response.getWriter();
		out.print(view.toString());
		out.flush();
		out.close();
	}

}
